package cn.dao.imp;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import cn.dao.BrandDao;
import cn.entity.Brand;

public class BrandDaoImp extends HibernateDaoSupport implements BrandDao {

	@Override
	public void insertOrUpdate(Brand brand) {
		getHibernateTemplate().saveOrUpdate(brand);
	}
	
	@Override
	public Brand getBrandById(Integer id) {
		return getHibernateTemplate().get(Brand.class, id);
	}

	@Override
	public List<Brand> getAll() {
		return getHibernateTemplate().find("from Brand");
	}

}
